"""
自定义异常
"""

from my_typing import *


class BusinessError(Exception):
    """ 自定义业务异常 """

    errors: ListStr

    def __init__(
        self,
        error: str | ListStr,
        *args,
        **kwargs,
    ) -> None:
        if isinstance(error, str):
            self.errors = [error]

        else:
            self.errors = error
